package com.huawei.java.main.algorithm;

public class Usage {
    private int current = 0;
    private int max = 0;

    public void add(int value) {
        current += value;
        if (current > max) {
            max = current;
        }
    }

    public void del(int value) {
        current -= value;
        if (current < 0) {
            throw new NumberFormatException();
        }
    }

    public int getCurrent() {
        return current;
    }

    public int getMax() {
        return max;
    }
}
